-
Notifications
You must be signed in to change notification settings - Fork 174
Introduce new extended attribute grammars #1503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These new grammars will be used by the HTML spec for attribute reflection extended attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with nit, although I presume we shouldn't merge this until we're sure they're going to be used.
Yeah I think it makes sense to wait until at least the non-enum IDL reflection stuff is agreed upon. That uses all 3 of these new grammars. |
…edAttributeDecimal
I think this is ready to go now. The python parser has been updated which I think is the main blocker. It seems the HTML PR is ready to go so these new grammars will end up being used. |
A number of extended attributes are added which trigger IDL attribute reflection: - [Reflect] and [Reflect=string] cover basic content attribute reflection cases. - [ReflectSetter] and [ReflectSetter=string] covers content attribute reflection only for setters. - [ReflectURL] and [ReflectURL=string] covers reflection of USV attributes, which represent URLs. - [ReflectNonNegative] and [ReflectNonNegative=string] covers reflection of long attributes that should be limited to only non-negative numbers. - [ReflectPositive] and [ReflectPositive=string] covers reflection of double and unsigned long attributes which should be limited to positive numbers. - [ReflectPositiveWithFallback] and [ReflectPositiveWithFallback=string] covers reflection of double and unsigned long attributes which should be limited to positive numbers with fallback. Additionally: - [ReflectRange=(integer, integer)] can be used alongside others on unsigned long attributes that should be clamped to a range. - [ReflectDefault=number] can be used alongside others on double, long and unsigned long attributes that should be reflected with a default value. Corresponding Web IDL PR: whatwg/webidl#1503.
Introduce four new extended attribute grammars
These new grammars will be used by the HTML spec for attribute reflection extended attributes. ExtendedAttributeString (
[Reflect="foo"]
), ExtendedAttributeInteger ([ReflectDefault=1]
), ExtendedAttributeDecimal ([ReflectDefault=1.0]
) and ExtendedAttributeIntegerList ([ReflectRange=(1,100)]
) are added.(See WHATWG Working Mode: Changes for more details.)
Preview | Diff